/*
* $Id: JournalTable.h 50 2010-03-03 15:11:54Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _JOURNAL_TABLE_H_
#define _JOURNAL_TABLE_H_

#include "../Table.h"
#include "../Operation.h"

class CJournalTable : public CTable, public CFillContent
{
public:
	CJournalTable();
	virtual ~CJournalTable();
public:
	struct content : public CTable::content{
		int s_nIdFamily;
		time_t s_date;
		int s_nFrame;
		int s_nStrength;
		enum queen_bee{
			DEFAULT = 0,
			LOOK,
			ABSENCE,
			FETAL
		}s_QueenBee;
		int s_nWax;
		int s_nAmbrosia;
		int s_nEvacuation;
		int s_nFeeding;
		enum disease{
			HEALTHY = 0,
			AFB,EFB,PFB,
			VARROA,
			ACARINE,
			NOSEMA,
			CHALKBROOD,
			STONEBROOD,
			ABPV,MILK,PBV,
			BQCV,CPV,CWV,
			DWV,SBV,CCD,
			GAFN,SALMON,
			SEPT,COLI,
			CITRO,SPIRO,
			FILO,MELONOZ,
			AMEBA,CRITI,
			MERM,PIE,EAP,
			GREG,SEN
		}s_disease;
		std::tstring s_strNote;
		int s_nIdRecord;
		content();
		virtual void Clear();
		virtual void Set(const std::vector<CTableItem>& aContent);
		virtual void Free();
	}m_content;
public:
	virtual void CreateTable(IDatabase* pDatabase);
	virtual void UpdateValue(IDatabase* pDatabase);
	virtual IResult* GetValue(IDatabase* pDatabase);
	virtual void SetValue(IDatabase* pDatabase);
	virtual void DeleteValue(IDatabase* pDatabase);
	virtual IOperation::i_content* CreateContent();
};

#endif/*_JOURNAL_TABLE_H_*/